package com.siashan.toolkit.oss.minio;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * MinIO OSS自动配置
 *
 * @author siashan
 * @date 2024/2/6
 **/
@Configuration
@EnableConfigurationProperties(MinioOssProperties.class)
public class MinioOssAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean
    public MinioOssProperties minioOssProperties() {
        return new MinioOssProperties();
    }


    @Bean
    @ConditionalOnMissingBean
    public MinioOssFactoryProvider minioOssFactoryProvider(MinioOssProperties minioOssProperties) {
        return new MinioOssFactoryProvider(minioOssProperties);
    }
}
